﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="./Public/Admin/Css/public.css" rel="stylesheet" type="text/css" />
<title>用户管理</title>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="border">
	<tr class="topbg"><td>用户管理</td></tr>
	<tr class="tdbg"><td height="30">&nbsp;&nbsp;<a href="?c=User&a=index">管理首页</a>&nbsp;|&nbsp;<a href="?c=User&a=add">添加用户</a></td></tr>
</table>
<br />
<form id="form1" name="form1" method="post" action="?c=User&a=update" onsubmit="return checkForm()">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="border">
	<tr class="title"><td colspan="2" align="center">修改用户</td></tr>
    <tr class="tdbg">
		<td width="15%" height="30" align="right">用户名称：</td>
		<td width="85%"><font color="#0000ff"> <{$user['username']}> </font></td>
    </tr>
    <tr class="tdbg">
		<td height="30" align="right">用户密码：</td>
		<td>
			<input name="password" type="password" id="password" size="20" maxlength="15" />
			<font color="#FF0000">*</font>
			<font color="#666666">长度为5-15位（字母、数字），不能含有特殊符号；不修改请留空！</font>
		</td>
    </tr>
    <tr class="tdbg">
		<td height="30" align="right">确认密码：</td>
		<td>
			<input name="confirmpwd" type="password" id="confirmpwd" size="20" maxlength="15" />
			<font color="#FF0000">*</font>
			<font color="#666666">两次输入的密码必须一致；不修改请留空！</font>
		</td>
    </tr>
    <tr class="tdbg">
		<td height="30" align="right">真实姓名：</td>
		<td>
			<input value="<{$user['name']}>" name="name" type="text" id="name" size="20" />
			<font color="#FF0000">*</font>
			<font color="#666666">你的姓名</font>
		</td>
    </tr>
    <tr class="tdbg">
		<td height="30" align="right">联系方式：</td>
		<td>
			<input value="<{$user['tel']}>" name="tel" type="text" id="tel" size="20" />
			<font color="#FF0000">*</font>
			<font color="#666666">例如：13671181498 或 010-12345678</font>
		</td>
    </tr>
    <tr class="tdbg">
		<td height="30" align="right">账号状态：</td>
		<td>
			<input type="radio" name="status" value="1" <{if $user['status'] eq 1 }> checked <{/if}> > 正常
			<input type="radio" name="status" value="0" <{if $user['status'] eq 0 }> checked <{/if}> > 停用
		</td>
	</tr>
    <tr class="tdbg">
		<td height="30" align="right">角色：</td>
		<td>超级管理员</td>
    </tr>
    <tr class="tdbg">
		<td height="30" align="right">&nbsp;</td>
		<td>
			<input type="submit" value="修改" />
			<input type="hidden" name="id" value="<{$user['id']}>" />
			<input type="button" onclick="history.go(-1)" value="返回" />
		</td>
    </tr>
  </table>
</form>
</body>
</html>
<script language="javascript">
function checkForm()
{
	//定义用户名、密码、电话的正则表达式
	var reg1 = /^(\w{5,15})$/;
	var reg2 = /^([0-9]{11}|[0-9]{3,4}-[0-9]{7,8})$/;
	if(!reg1.test(document.form1.password.value))
	{
		alert("用户密码没有填写或格式不正确！");
		document.form1.password.focus();
		return false;
	}else if(document.form1.password.value != document.form1.confirmpwd.value)
	{
		alert("两次输入的密码不一致！");
		document.form1.password.focus();
		return false;
	}else if(document.form1.name.value=="")
	{
		alert("你的姓名没有填写");
		document.form1.name.focus();
		return false;
	}else if(!reg2.test(document.form1.tel.value))
	{
		alert("联系方式没有输入或格式不正确");
		document.form1.tel.focus();
		return false;
	}
}
</script>